package com.jt.tenant.conn;

import com.jt.tenant.app.JTApplication;
import com.zcx.helper.http.AsyCallBack;
import com.zcx.helper.http.note.HttpInlet;

import org.json.JSONObject;

/**
 * Created by Administrator on 2016/3/2.
 */
@HttpInlet(Conn.INLET_SET_CAR_DETAIL)
public class SetCarDetail extends JTAsyGet<SetCarDetail.Info>{

    public String token = JTApplication.jtPreferences.readToken();

    public String carId = JTApplication.jtPreferences.readCarId();

    public String categoryId = JTApplication.jtPreferences.readCategoryId();

    public String city = JTApplication.jtPreferences.readCity();

    public String cityCode = JTApplication.jtPreferences.readCityCode();

    public String carType = JTApplication.jtPreferences.readCarType();

    public String pp = JTApplication.jtPreferences.readPP();

    public String pl = JTApplication.jtPreferences.readPL();

    public String nk = JTApplication.jtPreferences.readNK();

    public String cx = JTApplication.jtPreferences.readCategoryName();

    public String mc = JTApplication.jtPreferences.readBSX();

    public String plateNum ;

    public String vinCode;

    public String engineCode;

    public String remark;

    public SetCarDetail(String plateNum, String vinCode, String engineCode, String remark, String pp, String pl, String nk, String cx, String mc, AsyCallBack<Info> asyCallBack) {

        super(asyCallBack);

        this.plateNum = plateNum;

        this.vinCode = vinCode;

        this.engineCode = engineCode;

        this.remark = remark;

        this.pp = pp;

        this.pl = pl;

        this.nk = nk;

        this.cx = cx;

        this.mc = mc;
    }

    @Override
    protected Info parser(JSONObject object) {

        JSONObject apiTYF = object.optJSONObject("apiTYF");

        JSONObject head = apiTYF.optJSONObject("head");

        Info info = new Info();

        info.msg = head.optString("msg");

        return info;

    }

    public static class Info{

        public String msg;

    }

}
